<template>
  <a-cascader
    :options="cityList"
    style="width: 100%"
    v-bind="instance"
    @change="handleChange"
    v-model="defaultValue"
    placeholder="请选择所在的区域"
  />
</template>

<script>
import { cityList } from '../../../../MPlatformPortal/configs/cityList.js'

export default {
  props: {
    // 数据类型是object
    instance: Object
  },
  data() {
    return {
      defaultValue: undefined,
      selectOpt: {}, // 配置
      cityList
    }
  },
  watch: {
    instance: {
      handler(nVal) {
        Object.assign(this, { ...nVal }) // 把传入的参数，融合到this中
      },
      deep: true,
      immediate: true
    }
  },
  created() {
  },
  methods: {
    handleChange(value) {
      this.$emit('change', value)
    }
  }
}
</script>
